package com.yunduo.world.utils;

import com.yunduo.world.config.NettyConfig;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * 获取SpringBoot的bean实例
 */
public class YBeanUtils {
    private static ConfigurableApplicationContext context;

    public static void loadSpringContext(ConfigurableApplicationContext applicationContext){
        context = applicationContext;
    }

    public static NettyConfig nettyConfig(){
        return context.getBean("nettyConfig", NettyConfig.class);
    }
}
